/*
 * @Author: xiaosihan 
 * @Date: 2024-08-11 22:15:05 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2024-08-11 22:53:36
 */

import { Sprite, SpriteMaterial, SRGBColorSpace } from "three";
import cursorPNG from "./cursor.png";
import threeLoader from "three-base/threeLoader";


// 鼠标样式
export default class Cursor extends Sprite {
    constructor() {
        super();
        this.scale.set(0.1, 0.1, 0.1);
    }

    renderOrder = 999999;

    map = (() => {
        const map = threeLoader.getTexture(cursorPNG);
        map.colorSpace = SRGBColorSpace;
        return map;
    })();

    material = new SpriteMaterial({
        map: this.map,
        sizeAttenuation: false,
        depthTest: false,
        alphaTest: 0.1,
    });

}